const path = require("path");
const fs = require("fs-extra");
const API_PATH = path.resolve(__dirname, "../../src/api");
const ENV_PATH = path.resolve(__dirname, "../../.env.development");
fs.ensureDirSync(API_PATH, { recursive: true });
const BASE_URL = /^\s*VUE_APP_PROXY_API_ROOT=(\S*)/m.exec(fs.readFileSync(ENV_PATH, "utf-8"))[1];
const CONFIG_PARAM_COMMENT_STATEMENT = `\n * @param {import("axios").AxiosRequestConfig} [config]`;

module.exports = {
  API_PATH,
  CONFIG_PARAM_COMMENT_STATEMENT,
  API_DOC_URL: BASE_URL,
  REQUEST_METHODS_ORDER: {
    get: 1,
    post: 2,
    postWithQueryParams: 3,
    postFormData: 4,
  },
};
